package com.ydcycloud.job.controller.common;


import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.ydcycloud.base.bean.CommonResult;
import com.ydcycloud.base.enums.CommonEnums;
import com.ydcycloud.job.service.ProfessionService;
import com.ydcycloud.sys.controller.BaseWapController;

@Controller
@RequestMapping("/common/index")
public class ProfessionCommonController extends BaseWapController {

	@Resource
	private ProfessionService professionService;
	
	/**
	 * 获取职位列表
	 * @param size
	 * @return
	 */
	@RequestMapping("/getProfessionList")
	public @ResponseBody
	CommonResult getTradeList(Integer size) {
		CommonResult r = new CommonResult();
		try {
				r.setData(professionService.getProfessionList(size));
				commonEnums = CommonEnums.SUCCESS;//300 成功
			
		} catch (Exception e) {
			e.printStackTrace();
			commonEnums = CommonEnums.SYSTEM_ERROR; // 301 系统错误
		} finally {
			r.setStatus(commonEnums.getValue());
			r.setMessage(commonEnums.getLabel());
		}

		return r;
	}
	
	/*@RequestMapping("/findCompany")
	public @ResponseBody
	CommonResult findCompany(HttpServletRequest request, String companyName,
			String areaCode, String tradeName, Integer pageNo, Integer pageSize) {
		CommonResult r = new CommonResult();

		try {  
			if(pageNo == null || pageSize == null || pageNo < 1){
				commonEnums = CommonEnums.PARANETER_ERROR;//302 参数错误
			}else{
				Pagination<Map<String,Object>> p = professionService.findCompany(companyName, areaCode, tradeName, pageNo, pageSize);
				if(p != null){
					r.setData(CommonUtil.PaginationToMap(p, "list"));
				}
				commonEnums = CommonEnums.SUCCESS;//300 成功
			}
		} catch (Exception e) {
			e.printStackTrace();
			commonEnums = CommonEnums.SYSTEM_ERROR; // 301 系统错误
		} finally {
			r.setStatus(commonEnums.getValue());
			r.setMessage(commonEnums.getLabel());
		}

		return r;
	}*/
}
